#ifndef GLOBAL_H
#define GLOBAL_H
#include <QByteArray>
#include "Protocol/msgheader.h"
#include <QString>

///add a filed and the content to the data body
void addField(QByteArray &data,QString fieldname,const QString &content);
///fill a protocol MSGHeader
void constructHeader(MSGHeader &header,OPERATE opr,TARGET tar,int len,short s,int opt);
///input the protocol and data,the put them together and return the package
QByteArray generatePackage(MSGHeader header,const QByteArray &data);
#endif // GLOBAL_H
